package com.xxbb.springbootapi.controller;

import com.xxbb.springbootapi.entity.*;
import com.xxbb.springbootapi.entity.dto.loginDTO;
import com.xxbb.springbootapi.mapper.AccountMapper;
import com.xxbb.springbootapi.mapper.UserMapper;
import com.xxbb.springbootapi.service.impl.AccountService;
import com.xxbb.springbootapi.service.impl.BaseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RequestMapping("Accounts")
@Api(tags = "Account表")
@RestController
public class AccountController extends ApiController<AccountMapper,Account>{
    @Resource
    private AccountService service;

    @PostMapping("/login")
    @ApiOperation(value = "登录")
    public JsonResult Login(@RequestBody loginDTO dto) {
        return service.Login(dto.getAccount(), dto.getPassword());
    }
}
